package com.citycloud.ccuap.tc.oauth2.controller;


import org.springframework.http.HttpRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.citycloud.ccuap.tc.common.result.ResultObject;

@Controller
public class HomepageController {

    /**设置首页(默认页)跳转*/
    @GetMapping("/")
    public String defaultLogin() {
        return "forward:/index";
    }

    /**首页(默认页)*/
    @RequestMapping(
            value = {"/hello"},
            method = {RequestMethod.GET, RequestMethod.POST}
    )
    public @ResponseBody
    ResultObject<String> hello(HttpRequest request) {
        return ResultObject.getInstance().success("welcome");
    }


}
